teaching someone a lesson

教训某人
给某人一个教训